// @FileName  :abbr.c
// @Time      :2024/5/11 11:21
// @Author    :YKW
//# include <bits/stdc++.h>
//using namespace std;
# include <stdio.h>
# include <stdlib.h>
# include <math.h>
# include <string.h>
# include <stdlib.h>

int main() {
    char all[500], ans[500];
    int cnt = 0;
    gets(all);
    ans[cnt++] = all[0];
    for (int i = 1; i < strlen(all); i++) {
        int cc = 1;
        while (all[i] - all[i - 1] == 1) {
            cc++;
            i++;
        }
        if (cc > 2) {
            ans[cnt++] = '-';
            ans[cnt++] = all[i - 1];
            i--;
        } else {
            while (cc != 1)
                i--, cc--;
            ans[cnt++] = all[i];
        }
    }
    ans[cnt] = '\0';
    printf("%s", ans);
}